package com.kimi.weibo.ui;

import com.kimi.weibo.R;
import com.kimi.weibo.ui.base.IWeiboActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;
/**   
 *    
 * 项目名称：Myweibo   
 * 类名称：LogoActivity   
 * 类描述：   
 * 创建人：kimi   
 * 创建时间：2013-1-15 上午9:44:47   
 * 修改人：kimi   
 * 修改时间：2013-1-15 上午9:44:47   
 * 修改备注：   
 * @version    
 *    
 */
public class LogoActivity extends Activity implements IWeiboActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);

		setContentView(R.layout.logo);

		ImageView imv = (ImageView) this.findViewById(R.id.logo_img);

		Animation animation = new AlphaAnimation(0.0f, 1.0f);
		animation.setDuration(3000);
		animation.setAnimationListener(new AnimationListener() {

			@Override
			public void onAnimationStart(Animation animation) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onAnimationRepeat(Animation animation) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onAnimationEnd(Animation animation) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(LogoActivity.this,
						LoginActivity.class);
				startActivity(intent);
			}
		});
		imv.setAnimation(animation);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.logo, menu);
		return true;
	}

	/* (non-Javadoc)
	 * @see com.kimi.weibo.ui.base.IWeiboActivity#init()
	 */
	@Override
	public void init() {
		// TODO Auto-generated method stub
		
	}

	/* (non-Javadoc)
	 * @see com.kimi.weibo.ui.base.IWeiboActivity#refresh()
	 */
	@Override
	public void refresh(Object...params) {
		// TODO Auto-generated method stub
		
	}

}
